#@layout()

#define main()

<div class="jfa-header-box" id="jfa-header-box">
    <div class="jfa-crumbs" id="jfa-crumbs">
        工艺参数历史查询
    </div>
    #include("/_view/common/_header_right.html")
</div>
<div class="jfa-content-box" id="jfa-content-box">
    <div class="jfa-content" id="jfa-content">

        <div class="row">
            <div class="form-group col-lg-3">
                <label class="col-sm-4 control-label" >条码</label>
                <div class="col-sm-8">
                    <input type="text"  id="barcode" class="form-control" >
                </div>
            </div>

            <div class="form-group col-lg-3">
                <label class="col-sm-4 control-label">挂具编号</label>
                <div class="col-sm-8">
                    <input type="text"  id="rackNo" class="form-control" >
                </div>
            </div>

            <div class="form-group col-lg-3">
                <label class="col-sm-5 control-label">跟踪号</label>
                <div class="col-sm-7">
                    <input type="text"  id="traceCode" class="form-control">
                </div>
            </div>

            <div class="form-group col-lg-3 ">
                <div class="col-sm-12">
                    <button type="button" class="btn btn-primary col-sm-5 " onclick="search()">查询</button>
                </div>
            </div>
        </div>
        <div id="history">

        </div>

    </div>
</div>
<script type="text/javascript">

$('#history').bootstrapTable({
    url: '#(ctx)/admin/history/list',
    method: 'get',
    striped: true,
    cache: false,
    pagination: true,
    sortable: false,
    sortOrder: "asc",
    queryParams: function(params){
    		var data = {
                pageSize: params.limit,
                offset: params.offset，
                barcode: $("#barcode").val()，
                traceCode:$("#traceCode").val()，
                rackNo:$("#rackNo").val()
            };
            return data;
    },
    sidePagination: "server",
    pageNumber:1,
    toolbarAlign:"right",
    pageSize: 100,
    pageList: [100, 200, 300, 400,500],
    search: false,
    strictSearch: true,
    showColumns: false,
    showRefresh: false,
    minimumCountColumns: 2,
    clickToSelect: true,
   	height: datagridHeight,
    uniqueId: "id",
    showToggle:false,
    cardView: false,
    detailView: false,
    columns: [
        {
           field: 'start_time',title: '开始时间'
        },{
            field: 'end_time',  title: '结束时间'
        }, {
            field: 'hanger_no',  title: '挂具编号'
        }, {
            field: 'frame_no',  title: '电泳框编号'
        }, {
             field: 'material_no',  title: '物料编码'
        }, {
             field: 'barcode',  title: '条码号'
        }, {
             field: 'trace_no',  title: '跟综号'
        }, {
              field: 'remark',  title: '工位'
        }, {
             field: 'parameter_name',  title: '参数名称'
        }, {
              field: 'parameter_standard_value',  title: '控制线'
        }, {
               field: 'parameter_min_value',  title: '最小值'
        }, {
               field: 'parameter_max_value',  title: '最大值'
        }, {
            title: '历史曲线',formatter:curveFormatter
        }
    ]
});


function curveFormatter(value, row, index){
	return "<a href='#(ctx)/admin/history/curve?barcode="+row.barcode+
	 "&rackNo="+ row.rackNo+ "&startTime="+ row.startTime+ "&endTime="+ row.endTime+  "'>"+
	"<i class='fa fa-line-chart fa-2x' title='查看'></i>"
}
function search(){
    $('#history').bootstrapTable("refresh",{silent: true});
}
</script>
#end
